Skip to content

refactor: centralize sync polling in cron - #53

Merged
massimoalbarello merged 6 commits into
mainfrom
codex/centralize-sync-polling
Oct 2, 2026
Merged

massimoalbarello merged 6 commits into
mainfrom
codex/centralize-sync-polling

Conversation

@massimoalbarello

@massimoalbarello massimoalbarello commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Why

#49 introduced one shared cron, but syncs still carried individual polling intervals and due times. The cron should determine when every enabled sync polls and retries.

How

Remove per-sync intervals, polling deadlines, source retry backoff and its failure counter, and obsolete schedule displays. Each cron round polls enabled syncs and drains their pages; successful and failed syncs wait for the next tick. Overlapping triggers share the round. Manual execution, pauses, checkpoints, lease fencing, capacity recovery, and queued delivery retry policies remain intact.

Preserve the released schema as the initial migration and remove obsolete columns through a numbered forward SQL migration. SQLite parses and executes the plain SQL migration statements on the application's existing connection; the runner records migration history and rolls back failed upgrades. createOpenSync automatically migrates an existing data directory. Upgrade coverage creates that directory using published 0.3.1, then verifies preserved checkpoints, poll history, queued deliveries and asset bytes, provider configuration, owner isolation, and the embedding host's database.

Host callers must remove intervalMs and references to nextDueAt; there is no replacement per-sync deadline. Stop the host and back up its data directory before upgrading. Reverting to the previous binary requires restoring that backup.

@massimoalbarello
massimoalbarello merged commit c5b59dc into main Oct 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant